home *** CD-ROM | disk | FTP | other *** search
-
- #ifndef __MYUTILS__
- #include <myUtils.h>
- #endif
- #ifndef __CLIST__
- #include <CList.h>
- #endif
- #ifndef __CQUEUE__
- #include <CQueue.h>
- #endif
-
- #ifndef __MACTCPCOMMONTYPES__
- #include <MacTCPCommonTypes.h>
- #endif
- #ifndef __TCPPB__
- #include <TCPPB.h>
- #endif
-
- class InetD;
- class TCPListener;
-
- typedef struct MyTCPiopb {
- TCPiopb tcppb;
- long myA5;
- TCPListener* listener;
- } MyTCPiopb;
-
- class NoteeItem : public CItem {
- public:
- PSN fPSN;
- StreamPtr fStream;
- ProcPtr fProc;
- Ptr fUsrPtr;
-
- NoteeItem();
- };
-
- class NoteeList : public CList {
- public:
- NoteeItem* GetItem(PSNPtr psn);
- NoteeItem* GetItem(StreamPtr stream);
- };
-
- class TCPListener {
- public:
- CQueue fQueue;
- NoteeList fNoteeList;
-
- InetD* fDaemon;
-
- int fBufferSize;
-
- TCPListener(InetD* daemon);
- ~TCPListener();
-
- Boolean Initialize();
-
- void DoNull();
-
- void NotifyMe(PSNPtr psn, StreamPtr stream, ProcPtr proc, Ptr usr);
- void UnNotify(PSNPtr psn);
-
- void Release();
- void CloseDown(MyTCPiopb* pb);
- void ListenOn(tcp_port port);
- };
-
- extern "C" {
- pascal void TCPNotify( StreamPtr stream,
- unsigned short eventCode,
- Ptr userDataPtr,
- unsigned short termReason,
- struct ICMPReport* icmp);
-
- void TCPCompletion(TCPiopb* pb);
- };
-